<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
     

<h:head>
        <title>Central de Estagio Administração</title>
        <link rel="StyleSheet" type="text/css" href="#{facesContext.externalContext.requestContextPath}/css/estilo.css" media="screen" />
        <link type="text/css" rel="stylesheet" href="#{facesContext.externalContext.requestContextPath}/css/tema/theme.css"/>
</h:head>
<body>
     <div align="center">
      	
		<h:form>
        
       	  	
        	<p:dataTable id="list" value="#{MBCbo.listarCbo}" var="cbo" paginator="true" rows="8"
        		emptyMessage="Nenhum registro encontrado." paginatorPosition="bottom">
        		
        		<p:ajax event="rowToggle" />
     		    <p:column style="width: 0.5%;">
                <p:rowToggler />
                </p:column>        		
        	<p:column style="width: 20%;" headerText="Código" filterBy="#{cbo.codCBO}" filterMatchMode="startsWith">
        		<h:outputText value="#{cbo.codCBO}"/>
        	</p:column>
        	<p:column style="width: 40%;" headerText="Descrição" filterBy="#{cbo.descCBO}" filterMatchMode="startsWith">>
        		<h:outputText value="#{cbo.descCBO}"/>
        	</p:column>
        	
        		<p:rowExpansion>
        			<p:column>
        			<p:commandButton value="Alterar" action="#{MBCbo.prepararUp}" icon="ui-icon-pencil"/>
        			</p:column>
        			<p:column>
        			<p:commandButton value="Remover" action="#{MBCbo.delete}" icon="ui-icon-trash" update="list"/>
        			</p:column>
        		</p:rowExpansion>
        
        	</p:dataTable>
      
        </h:form>  
      	  </div>	
</body>
</html>